package org.longxin.domains;

// Generated 2015-1-5 21:21:32 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;

/**
 * Department generated by hbm2java
 */
@Entity
@Table(name = "department", catalog = "longxin")
public class Department implements java.io.Serializable
{
	private static final long serialVersionUID = 763669346047687947L;
	private Integer id;
	private String departmentname;
	private Set<Users> userses = new HashSet<Users>(0);

	public Department()
	{
	}

	public Department(String departmentname)
	{
		this.departmentname = departmentname;
	}

	public Department(String departmentname, Set<Users> userses)
	{
		this.departmentname = departmentname;
		this.userses = userses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId()
	{
		return this.id;
	}

	public void setId(Integer id)
	{
		this.id = id;
	}

	@Column(name = "DEPARTMENTNAME", nullable = false, length = 45)
	public String getDepartmentname()
	{
		return this.departmentname;
	}

	public void setDepartmentname(String departmentname)
	{
		this.departmentname = departmentname;
	}

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "department")
	@JsonIgnore
	public Set<Users> getUserses()
	{
		return this.userses;
	}

	public void setUserses(Set<Users> userses)
	{
		this.userses = userses;
	}

}
